/**
 *  @file
 *  @brief   小量drill 膜单元
 *  @author  yangtianxing
 *  @date    2024.05.16
 *  @version  v1.0
 *  @par Copyright(c):  ShenGong  Simulation corporation
 */

#pragma once
#include "Utility/Algebra/Matrix.h"

#include "DataStructure/Common/Out.h"
#include "DataStructure/Common/Real.h"

#include "MemElement.h"

/** @brief 小量Drill三角形膜单元
 *
 * 通过增加一个小量提供膜的drill刚度
 */
class PublicElement_DECLSPEC Tria3SmallDrillMem : public MemElement
{
  public:
    Tria3SmallDrillMem () = default;
    /// @brief 计算和节点坐标无关的变量
    void Initialize ();

    /// @brief 计算应变矩阵
    /// @param [in] iGauss 积分点索引
    /// @param [in] coord 单元节点坐标
    /// @param [out] B    应变矩阵
    /// @param [out] j 积分点雅克比的行列式值
    void ComputeStrainMatrix (const SG::Algebra::Matrix& coord, _OUT SG::Algebra::Matrix& B) const;

    /// @brief 计算单元刚度矩阵
    /// @param [in] coord  提供局部坐标系
    /// @param [in] Cm     膜部分材料刚度3*3矩阵 Cm
    SG::Algebra::Matrix ComputeStiffness (const SG::Algebra::Matrix& coord, const SG::Algebra::Matrix& Cm) const;

  private:
    static std::size_t s_nNode;
};